﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LbangCMS.Areas.WeChat.Controllers
{
    public class HomeController : Controller
    {
        // GET: WeChat/Home
        public ActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public ActionResult GetRecommendCommodities()
        {
            var model = new List<CommodityModel>();
            for (int i = 0; i < 4; i++)
            {
                model.Add(new CommodityModel { Name = i.ToString(), Price = (i * 10M).ToString("0.00"), ImageSrc = "http://localhost:16157/areas/WeChat/images/pic.png" });
            }
            return Json(model,JsonRequestBehavior.AllowGet);
        }
    }

    public class CommodityModel
    {
        public string Name { get; set; }
        public string ImageSrc { get; set; }

        public string Price { get; set; }
    }
}